import { httpJson } from "./http";
import request from './request'
import { METHODS } from '@/config'
import { API_PREFIX } from '@/config'
//修改登录密码 用旧密码
const changePassword = (params) => {
    return httpJson({
        url: "/api/user!updateOldAndNewPsw.action",
        method: "get",
        isLoading: true
    }, params)
};
//修改登录密码 用验证码
const updatepsw = (params) => {
    return httpJson({
        url: "/api/user!updatepsw.action",
        method: "get",
        isLoading: true
    }, params)
};

//重置登录密码 用验证码 （用于忘记密码）
const resetpsw = (params) => {
    return httpJson({
        url: "/api/user!resetpsw.action",
        method: "get",
        isLoading: true
    }, params)
};


//设置资金密码
const setSafewordReg = (params) => {
    return httpJson({
        url: "/api/user!setSafewordReg.action",
        method: "get",
        isLoading: true
    }, params)
};
//修改资金密码 用旧密码
const changeFundsPassword = (params) => {
    return httpJson({
        url: "/api/user!updateOldAndNewSafeword.action",
        method: "get",
        isLoading: true
    }, params)
};
//修改资金密码 用验证码
const setSafeword = (params) => {
    return httpJson({
        url: "/api/user!setSafeword.action",
        method: "get",
        isLoading: true
    }, params)
};

//绑定邮箱
const bindEmail = (params) => {
    return httpJson({
        url: "/api/localuser!save_email.action",
        method: "get",
        isLoading: true
    }, params)
};
//绑定手机
const bindPhone = (params) => {
    return httpJson({
        url: "/api/localuser!save_phone.action",
        method: "get",
        isLoading: false
    }, params)
};
//获取验证方式(token)
const getVerifTarget = (params) => {
    return httpJson({
        url: "/api/user!getVerifTarget.action",
        method: "get",
        isLoading: false
    }, params)
};

//获取验证方式（用户名）
const getUserNameVerifTarget = (params) => {
    return httpJson({
        url: "/api/user!getUserNameVerifTarget.action",
        method: "get",
        isLoading: true
    }, params)
};


//获取谷歌验证器绑定信息
const getGoogleauth = (params) => {
    return httpJson({
        url: "/api/googleauth!get.action",
        method: "get",
        isLoading: false
    }, params)
};

//谷歌验证器绑定
const bindGoogleauth = (params) => {
    return httpJson({
        url: "/api/googleauth!bind.action",
        method: "get",
        isLoading: true
    }, params)
};

//获取人工重置信息
const getSafewordApply = (params) => {
    return httpJson({
        url: "/api/user!get_safeword_apply.action",

        method: "get",
        isLoading: true
    }, params)
};
//人工重置申请
const setSafewordApply = (params) => {
    return httpJson({
        url: "/api/user!set_safeword_apply.action",
        method: "get",
        isLoading: true
    }, params)
};

//个人信息
const localuserAction = (params) => {
    return httpJson({
        url: "/api/localuser!get.action",
        method: "get",
        isLoading: false
    }, params)
};
//高级认证申请
const kycHighLevelApply = (params) => {
    return httpJson({
        url: "/api/kycHighLevel!apply.action",
        method: "get",
        isLoading: false
    }, params)
};
//高级认证信息
const getKycHighLevel = (params) => {
    return httpJson({
        url: "/api/kycHighLevel!get.action",
        method: "get",
        isLoading: false
    }, params)
};

//轮播
const getBanner = (params) => {
    return httpJson({
        url: "/api/banner!list.action",
        method: "get",
        isLoading: false
    }, params)
};

//服务条款
const getCms = (params) => {
    return httpJson({
        url: "/api/cms!get.action",
        method: "get",
        isLoading: false
    }, params)
};


//获取新闻列表
const _getNewsList = (params) => {
    return httpJson({
        url: "/api/news!list_v2.action",
        method: "get",
        isLoading: false,
    }, params)
};

//获取新闻列表(首页新闻轮播)
const _getNewsList1 = (params) => {
    return httpJson({
        url: "/api/news!list.action",
        method: "get",
        isLoading: false,
    }, params)
};

//获取新闻详情
const _getNews = (params) => {
    return httpJson({
        url: "/api/news!get.action",
        method: "get",
        isLoading: false,
    }, params)
};

//获取弹出新闻
const _getPopupNews = (params) => {
    return httpJson({
        url: "/api/news!list_v2_popup.action",
        method: "get",
        isLoading: false,
    }, params)
};

const apiList = {
    changePassword, updatepsw, resetpsw, setSafewordReg, changeFundsPassword, getVerifTarget, getUserNameVerifTarget, setSafeword, bindEmail, bindPhone, getGoogleauth, bindGoogleauth, getSafewordApply, setSafewordApply,
    localuserAction, kycHighLevelApply, getKycHighLevel, getBanner,
    getCms, _getNewsList, _getNewsList1, _getNews, _getPopupNews
}

export default apiList
